package com.qfedu.meidijiaju.service.impl;



import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qfedu.meidijiaju.common.ResponseData;
import com.qfedu.meidijiaju.entity.StSoft;
import com.qfedu.meidijiaju.mapper.StSoftMapper;
import com.qfedu.meidijiaju.service.StSoftService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author meidimeiju
 * @since 2022-10-05
 */
@Service
public class StSoftServiceImpl extends ServiceImpl<StSoftMapper, StSoft> implements StSoftService {

    @Resource
    private StSoftMapper stSoftMapper;

    @Override
    public ResponseData<List<StSoft>> queryShoppingByTypeId(int typeId) {

        ResponseData<List<StSoft>> responseData = new ResponseData<>();

        List<StSoft> stSoft = stSoftMapper.queryShoppingByTypeId(typeId);

        if (stSoft != null && stSoft.size() != 0){
            responseData.setCode(200);

            responseData.setData(stSoft);

        } else {
            responseData.setCode(400);

            responseData.setMsg("无数据");

        }
        return responseData;
    }
}
